package com.wwk.core.pullrefresh;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.wwk.core.R;

import java.util.ArrayList;

/**
 * Created by Administrator on 2016/12/29.
 */

public class Container_Adapter extends BaseAdapter {
    public ArrayList<Integer> listData = new ArrayList<>();
    private Context mContext;
    private int count;

    public Container_Adapter(Context context, ArrayList<Integer> listData, int count) {
        this.listData = listData;
        this.mContext = context;
        this.count = count;
    }

    @Override
    public int getCount() {
        return listData.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder viewHolder = null;
        if (convertView == null) {
            convertView = View.inflate(mContext, R.layout.image_list_item, null);
            viewHolder = new ViewHolder();
            viewHolder.imageListImage = (ImageView) convertView.findViewById(R.id.image_list_image);
            viewHolder.imageListText = (TextView) convertView.findViewById(R.id.image_list_text);
            convertView.setTag(viewHolder);
        } else {
            viewHolder = (ViewHolder) convertView.getTag();
        }
        viewHolder.imageListText.setText("item" + position);
        return convertView;
    }

    private class ViewHolder {
        ImageView imageListImage;
        TextView imageListText;
    }
}
